package com.dfdchem.imd.kaiwu.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.dfdchem.imd.kaiwu.R;
import com.dfdchem.imd.kaiwu.activity.base.BaseActivityUM;
import com.dfdchem.imd.kaiwu.constant.RouterPath;


public class StepThreeFragment extends Fragment {

    private TextView mGoHomeTv;

    public static StepThreeFragment newInstance() {

        return new StepThreeFragment();
    }

    private void initView(View view) {

        mGoHomeTv = (TextView) view.findViewById(R.id.guide_go_home_tv);
    }

    private void initData() {

    }

    private void initListeners() {

        mGoHomeTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                gotoHome();
            }
        });
    }

    private void gotoHome() {
        BaseActivityUM activity = (BaseActivityUM) getActivity();
        if (null != activity) {
            activity.toActivity(RouterPath.MAIN_ACTIVITY, true, android.R.anim.fade_in, android.R.anim.fade_out);
        }
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(final LayoutInflater inflater,
                             ViewGroup container, Bundle savedInstanceState) {

        final View view = inflater.inflate(R.layout.fragment_step_three,
                container, false);
        initView(view);
        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        initData();
        initListeners();
    }
}
